package com.ipay.conf;

import com.alibaba.druid.pool.DruidDataSource;
import com.zaxxer.hikari.HikariDataSource;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.annotation.Primary;

import javax.sql.DataSource;


/**
 * @author ：前世小和尚（xiaopingzhang8@creditease.cn）
 * @Description ：
 * @ClassName ：DataSourceConfig
 * @Company ：普信恒业科技发展（北京）有限公司
 * @date ：2018/4/10 11:36
 */
//@Configuration
//@ImportResource(locations = {"classpath*:/conf/spring-mybatis.xml"})
//@ConditionalOnClass(DruidDataSource.class)
//@ConditionalOnProperty(name = "spring.datasource.type", havingValue = "com.alibaba.druid.pool.DruidDataSource", matchIfMissing = true)
public class DataSourceConfig {


//    @Bean
//    @ConfigurationProperties(prefix = "spring.datasource")
//    @Primary
//    public DataSource getDataSource(DataSourceProperties properties) {
//        return properties.initializeDataSourceBuilder().build();
//    }
}
